package test.example.controller;

import org.slim3.controller.Controller;
import org.slim3.controller.Navigation;
import org.slim3.memcache.Memcache;

import test.example.auth.GoogleConnection;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

public class LogOutController extends Controller {

    @Override
    public Navigation run()  {
        try{
            GoogleConnection.getInstance().connectionStop(request,response);
            UserService u = UserServiceFactory.getUserService();
            return forward(u.createLogoutURL("/index.html"));   
        }catch(Exception e){
            return forward("/index.html");
        }
    }
}
